import * as mock from 'mockjs';
const Random = mock.Random;
// 产品详情
mock.mock(/\/product-detail/, 'get', (option: any) => {
  const id = option.url.split('=')[1];
  return {
    status: 200,
    data: {
      id,
      product_name: Random.cword(15, 25),
      serviceDesc: [
        {
          title: '全厂包邮',
          desc: '所有商品包邮（除偏远地区',
        },
        {
          title: '7天无理由退货',
          desc: '满足相应条件时，消费者可申请“7天无理由退货”',
        },
        {
          title: '48小时发货',
          desc: '若超时未发货，消费者将会收到至少3元无门槛代金券',
        },
      ],
      tags: ['即日起活肤150元', '10元无门栏优惠券', '5元优惠券'],
      banner: [
        {
          link: '',
          imageUrl: Random.image('375x375'),
        },
        {
          link: '',
          imageUrl: Random.image('375x375'),
        },
        {
          link: '',
          imageUrl: Random.image('375x375'),
        },
      ],
      productDetail: [
        {
          id: 555,
          title: '测试555555555',
          price: Random.float(10, 1000, 1, 2),
          imageUrl:
            'https://img.alicdn.com/imgextra/i3/1659066935/O1CN01vYOKNC216HOyIuWyg_!!0-item_pic.jpg_120x120q50s150.jpg',
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl:
            'https://img.alicdn.com/imgextra/i3/470168984/O1CN01yY51HW2GEiwUfqfJI_!!0-item_pic.jpg_760x760Q50s50.jpg_.webp',
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl:
            'https://img.alicdn.com/bao/uploaded/i1/470168984/O1CN01Yn5bmC2GEirhW79IK_!!470168984.jpg_760x760Q50s50.jpg_.webp',
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
        {
          id: Random.id(),
          title: Random.cword(5, 10),
          price: Random.float(10, 1000, 1, 2),
          imageUrl: Random.image('100x100'),
        },
      ],
      price: 5,
    },
  };
});
// 产品正在拼单的用户
mock.mock(/\/product-receivingOrder/, 'get', {
  'orderList|2-8': [
    {
      productId: '@Id()',
      startAt: "@datetime('yyyy-MM-dd HH:mm:ss')",
      imageUrl: "@image('50x50')",
      userName: '@cword(5,10)',
      remainingNumber: '@natural(1,2)',
    },
  ],
});
